﻿using LDAP.Entity;
using System;
using System.Web;
using System.Web.UI;
using System.Linq;

namespace LDAP.Web
{
    /// <summary>
    /// 页面基类
    /// </summary>
    public class AngelBasePage : BasePage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (!IsSuperAdministrator() && !IsAngel())
            {
                Response.Write("当前用户"+ CurrentUser.UserName+"("+CurrentUser.Id+") 没有权限！");
                Response.End();
            }
        }

        public bool IsSuperAdministrator()
        {
            return CurrentUser.Id.ToUpper() == "CY7539";
        }

        public bool IsAngel()
        {
            return LDAP.BLL.BizAngel.IsAngel(CurrentUser.Id);
        }
    }
}